Skip to content

Feature/gradient occupancy#66

Merged
MultyXu merged 12 commits into
developfrom
feature/gradient_occupancy
Jun 26, 2026
Merged

Feature/gradient occupancy#66
MultyXu merged 12 commits into
developfrom
feature/gradient_occupancy

Conversation

@MultyXu

@MultyXu MultyXu commented Apr 15, 2026

Copy link
Copy Markdown

Add a gradient-based map publisher for the mid-level planner and other functionalities.

@MultyXu MultyXu marked this pull request as draft April 15, 2026 11:37
@MultyXu MultyXu requested a review from nathanhhughes April 15, 2026 11:51
@MultyXu

MultyXu commented Apr 15, 2026

Copy link
Copy Markdown
Author

@nathanhhughes The old tsdf occupancy publisher broke when there were ramps and hills, causing some issues with the mid-level planner. I'm not sure if these changes are ready to be merged and how we should try that in the DCSIT system. So I thought it was best to pin you to get an idea.

@nathanhhughes

Copy link
Copy Markdown
Collaborator

@MultyXu yeah, this will need some work on the Hydra side to actually merge in (it doesn't make sense to duplicate the code and work of the gradient-based traversability estimator), but easy to keep rebasing on top of develop if we have to make other changes to Hydra-Ros

@MultyXu MultyXu force-pushed the feature/gradient_occupancy branch from e237833 to 5092844 Compare June 24, 2026 00:17

@nathanhhughes nathanhhughes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's still too much duplication with the code and computation in Hydra and we should fix that before merging this

float confidence = 0.0f; // num_neighbors / 8.0
};

class TsdfGradientOccupancyPublisher : public ReconstructionModule::Sink {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should just add this as a sink to the traversability estimator instead of the reconstruction module (which would help drop the requirement for most of the code duplication), but we can also talk about what kind of architecture makes sense (we can also think about publishing this as a cost map instead of a occupancy grid and refining the mid-level planner to be able to take that as well)

@MultyXu MultyXu marked this pull request as ready for review June 25, 2026 23:09
@MultyXu

MultyXu commented Jun 25, 2026

Copy link
Copy Markdown
Author

Will need this PR

@nathanhhughes nathanhhughes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me! Not a big deal that this is specialized to the gradient-based estimator at the moment, we can tweak what the sink looks like later if it turns out we want to have a more general "cost map" publisher

Comment on lines +179 to +189
if (config.add_robot_footprint) {
const Eigen::Vector3f pos_3d(pos.x(), pos.y(), 0.0f);
if (bbox.contains((sensor_T_world * pos_3d).eval())) {
msg.data[index] = 0;
continue;
}
}

msg.data[index] =
gradientToOccupancy(gradient_info.gradient, gradient_info.confidence);
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically these should be swapped (the idea being that the footprint is a pessimistic volume that overrides cells to be free if the robot is currently occupying them), but this is not a big deal either way

@MultyXu MultyXu merged commit 27a18f0 into develop Jun 26, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants